package org.ykh.gmall.feign.product.client;


import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.ykh.gmall.product.*;
import org.ykh.gmall.feign.product.client.impl.ProductDegradeFeignClient;
import org.ykh.gmall.result.Result;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@FeignClient(value = "gmall-product",fallback = ProductDegradeFeignClient.class)
public interface ProductFeignClient {
    /**
     * 获取首页分类数据
     * api/product/getBaseCategoryList
     * @return
     */
    @GetMapping("/api/product/getBaseCategoryList")
    public Result getBaseCategoryList();

    /**
     * 根据spuId 获取到销售属性值Id 与skuId 组成的结果集
     * /api/product/inner/getSkuValueIdsMap/{spuId}
     *
     * @param spuId
     * @return
     */
    @GetMapping("/api/product/inner/getSkuValueIdsMap/{spuId}")
    public Map getSkuValueIdsMap(@PathVariable("spuId") Long spuId);



    /**
     * api/product/inner/getAttrList/{skuId}
     * 根据skuId 获取平台属性数据
     * @param skuId
     * @return
     */
    @GetMapping("/api/product/inner/getAttrList/{skuId}")
    public List<BaseAttrInfo> getAttrList(@PathVariable("skuId") Long skuId);


    /**
     * /api/product/inner/findSpuPosterBySpuId/{spuId}
     * 根据spuId 获取海报数据
     * @param spuId
     * @return
     */
    @GetMapping("/api/product/inner/findSpuPosterBySpuId/{spuId}")
    public List<SpuPoster> findSpuPosterBySpuId(@PathVariable("spuId") Long  spuId);
    /**
     * 根据spuId,skuId 获取销售属性数据
     * api/product/inner/getSpuSaleAttrListCheckBySku/{skuId}/{spuId}
     *
     * @param skuId
     * @param spuId
     * @return
     */
    @GetMapping("/api/product/inner/getSpuSaleAttrListCheckBySku/{skuId}/{spuId}")
    public List<SpuSaleAttr> getSpuSaleAttrListCheckBySku(@PathVariable("skuId") Long skuId,
                                                          @PathVariable("spuId") Long spuId);


    /**
     * 根据三级分类id获取分类信息
     * api/product/inner/getCategoryView/{category3Id}
     * @param category3Id
     * @return
     */
    @GetMapping("/api/product/inner/getCategoryView/{category3Id}")
    public BaseCategoryView getCategoryView(@PathVariable("category3Id") Long category3Id );



    /**
     * 根据skuId 获取最新的商品价格
     * /api/product/inner/getSkuPrice/{skuId}
     * @param skuId
     * @return
     */
    @GetMapping("/api/product/inner/getSkuPrice/{skuId}")
    public BigDecimal getSkuPrice(@PathVariable("skuId") Long skuId);

    /**
     *根据skuId获取SkuInfo
     * /api/product/inner/getSkuInfo/{skuId}
     * @param skuId
     * @return
     */
    @GetMapping("/api/product/inner/getSkuInfo/{skuId}")
    public SkuInfo getSkuInfo(@PathVariable("skuId") Long skuId);

    /**
     *  /api/product/inner/getTrademark/{tmId}
     * 根据品牌id查询品牌对象
     * @param tmId
     * @return
     */
    @GetMapping("/api/product/inner/getTrademark/{tmId}")
    public BaseTrademark getTrademark(@PathVariable("tmId") Long tmId);
}
